(function(){
	window.sceneConversion=Class.extend({
		init:function(params) {
            var self = this;
            this.ele = params.ele;
			this.fadeIn = params.fadeIn;
			this.fadeOut = params.fadeOut;
			this.Operating = params.Operating;
			this.list=[]
            this.start()
			this.startback();
			if(typeof self.Operating=="function"){
				self.Operating()
			}
        },
		start:function() {
			var self = this;
			$("[start]").on("click",function(){
				var box=$(this).attr("href");
				self.list.push(box)
				$(self.ele).hide(0,function(){$(this).removeClass(self.fadeIn);$(this).removeClass(self.fadeOut)})
				$(box).show(0,function(){$(this).addClass(self.fadeIn)})
				return false
			})
		},
		startback:function() {
			 var self = this;
			 $("[startback]").on("click",function(){
			    self.fun(self);
				return false
			})
		},
		revoke:function(){
			     var self = this;
			     self.fun(self)
		},
		fun:function(self){
			    $(self.ele).hide(0,function(){$(this).removeClass(self.fadeIn);$(this).removeClass(self.fadeOut)})
			
				if(typeof self.list[self.list.length-2] !="undefined"){
				   $(self.list[self.list.length-2]).show(0,function(){$(this).addClass(self.fadeOut)})
				}
				else
				{
					 $(self.ele).eq(0).show(0)
					
					
				}
				self.list.pop();
				console.log(self.list)
		}
	})
})()